/*
 *
 *  * Copyright (c) 2016. For Intelligent Group.
 *
 */

package com.intelligent.mts.client.core.view;

import com.intelligent.mts.client.core.controller.MainController;
import com.intelligent.mts.client.core.modal.ProcessDataModal;
import com.intelligent.mts.client.event.ResearchDataEvent;
import com.intelligent.mts.client.event.StatusBarChangeEvent;
import com.intelligent.mts.client.ex.JTableEx;
import com.intelligent.mts.client.utils.*;
import com.intelligent.mts.common.utils.ApplicationException;
import com.intelligent.mts.common.utils.ExceptionMessages;
import com.intelligent.mts.common.utils.StringUtils;
import com.intelligent.mts.core.dto.AttributeDto;
import com.intelligent.mts.core.dto.SerialNumberDto;
import com.intelligent.mts.core.dto.TrackDto;
import com.intelligent.mts.core.utils.AppConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

/**
 * Created by Peter on 2016/7/21.
 */
@Component
public class MainAttrPanel extends JPanel {

    @Autowired
    private MainController mainController;

    private ProcessDataModal processDataModal;
    private String currentProductionId;
    private String currentSn;

    public void reloadTable(List<AttributeDto> attributeDtoList) {
        processDataModal.setData(attributeDtoList);
        processDataTable.setModel(processDataModal);
    }

    public void setTextFieldValues(List<SerialNumberDto> serialNumberDtoList, TrackDto
            trackDto,String customerName) {
        clearTxtValue();
        if (trackDto != null) {
            if (trackDto.getProductionId() != null) {
                currentProductionId = trackDto.getProductionId();
                if (trackDto.getStationId() != null && !"0930".equals
                        (trackDto.getStationId()) && "NG".equals(trackDto.getStatus())) {
                    btnSetOk.setEnabled(true);
                } else {
                    btnSetOk.setEnabled(false);
                }
                if (AppConst.RESULT_DEBUG.equals(trackDto.getStatus())){
                    btnsetDebug.setEnabled(false);
                }else
                    btnsetDebug.setEnabled(true);
            }
            lblLineNameValue.setText(trackDto.getLineId());


            if("0610".equals(trackDto.getStationId()) || "0420".equals(trackDto.getStationId()) || "1060".equals(trackDto.getStationId())){
                btnsetDebug.setEnabled(false);
            }

            if (trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_0650) || trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_0690) ||
                    trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_0750) || trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_0990) ||
                    trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_1020) || trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_1030) ||
                    trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_1050) || trackDto.getProductionId().equals(AppConst.PRODUCTION_ID_1060)){
                btnsetDebug.setEnabled(false);
            }

//            if ( "0620".equals(trackDto.getStationId()) || "0930".equals(trackDto.getStationId())){
//                btnsetDebug.setEnabled(false);
//                btnSetOk.setEnabled(false);
//            }

            lblCurrentStatusValue.setText(trackDto.getStationId() + " - " + (trackDto.getStatus().equals(AppConst.RESULT_DEBUG)  ? (AppConst.RESULT_DEBUG +" OK") : trackDto.getStatus()));
            List<ProcessMessage> processMessageList = MessageUtils.getProcessMessage();
            String lastStationId = processMessageList.get(processMessageList.size() -
                    1).getSid();
            if (StringUtils.isBlank(trackDto.getStationId())) {
                lblStatusValue.setText("");
            } else if (!StringUtils.isBlank(lastStationId) && lastStationId.equals
                    (trackDto.getStationId()) && "ok".equalsIgnoreCase(trackDto.getStatus())) {
                lblStatusValue.setText("Finished");
            } else {
                lblStatusValue.setText("Processing");
            }

            lblNextStationValue.setText(trackDto.getNextStation());
        }
//        clearTxtValue();
        lblCustomerValue.setText(customerName);

        if (serialNumberDtoList != null) {
            String serialNames [] = {"PCBA", "HS", "HOU", "DSP_P", "DSP_S", "GW", "FG_END"};
            for (SerialNumberDto serialNumberDto : serialNumberDtoList) {
                if (serialNames[0].equalsIgnoreCase(serialNumberDto.getSerialName())) {
                    currentSn = serialNumberDto.getSerialValue();
                    lblPcbaSnValue.setText(serialNumberDto.getSerialValue());
                    lblPcbaPnValue.setText(serialNumberDto.getPnValue());
                } else if (serialNames[1].equalsIgnoreCase(serialNumberDto.getSerialName
                        ())) {
                    currentSn = serialNumberDto.getSerialValue();
                    lblHeatSinkSnValue.setText(serialNumberDto.getSerialValue());
                    lblHeatSinkPnValue.setText(serialNumberDto.getPnValue());
                } else if (serialNames[2].equalsIgnoreCase(serialNumberDto.getSerialName
                        ())) {
                    currentSn = serialNumberDto.getSerialValue();
                    lblHousingSnValue.setText(serialNumberDto.getSerialValue());
                    lblHousingPnValue.setText(serialNumberDto.getPnValue());
                } else if (serialNames[3].equalsIgnoreCase(serialNumberDto.getSerialName
                        ())) {
                    lblThtSnValue.setText(serialNumberDto.getSerialValue());
                    lblDSPPPnValue.setText(serialNumberDto.getPnValue());
                } else if (serialNames[4].equalsIgnoreCase(serialNumberDto.getSerialName
                        ())) {
                    lblDspSnValue.setText(serialNumberDto.getSerialValue());
                    lblDSPSPnValue.setText(serialNumberDto.getPnValue());
                } else if (serialNames[5].equalsIgnoreCase(serialNumberDto.getSerialName
                        ())) {
                    lblGwSnValue.setText(serialNumberDto.getSerialValue());
                    lblGwPnValue.setText(serialNumberDto.getPnValue());
                }
                else if (serialNames[6].equalsIgnoreCase(serialNumberDto.getSerialName()))
                {
                    lblFgSnValue.setText(serialNumberDto.getSerialValue());
                    lblFgPnValue.setText(serialNumberDto.getPnValue());
                }
            }
        }
    }

    @PostConstruct
    private void initComponents() {
        String columns[] = new String[]{"Station Id", "Order", "Value"};
        processDataModal = new ProcessDataModal(columns);



        leftInfoPanel = new JPanel();
        rightInfoPanel = new JPanel();
        lblLineNameKey = new JLabel();
        lblLineNameValue = new JTextField();
        lblCurrentStatusKey = new JLabel();
        lblCurrentStatusValue = new JTextField();
        lblNextStationKey = new JLabel();
        lblNextStationValue = new JTextField();
        lblPcbaSnKey = new JLabel();
        lblPcbaSnValue = new JTextField();
        lblHeatSinkSnKey = new JLabel();
        lblHeatSinkSnValue = new JTextField();
        lblHousingSnKey = new JLabel();
        lblHousingSnValue = new JTextField();
        lblThtSnKey = new JLabel();
        lblThtSnValue = new JTextField();
        lblDspSnKey = new JLabel();
        lblDspSnValue = new JTextField();
        lblGwSnKey = new JLabel();
        lblGwSnValue = new JTextField();
        lblStatusKey = new JLabel();
        lblStatusValue = new JTextField();
        processDataTable = new JTableEx();

        lblFgPnKey = new JLabel();
        lblFgPnValue = new JTextField();
        lblFgSnKey = new JLabel();
        lblFgSnValue = new JTextField();
        lblPcbaPnKey = new JLabel();
        lblPcbaPnValue = new JTextField();
        lblHeatSinkPnKey = new JLabel();
        lblHeatSinkPnValue = new JTextField();
        lblCustomerKey = new JLabel();
        lblCustomerValue = new JTextField();

        lblHousingPnKey = new JLabel();
        lblHousingPnValue = new JTextField();
        lblGwPnKey = new JLabel();
        lblGwPnValue = new JTextField();
        lblDSPPPnKey = new JLabel();
        lblDSPPPnValue = new JTextField();
        lblDSPSPnSKey = new JLabel();
        lblDSPSPnValue = new JTextField();

        btnSetOk = new JButton("Set OK");
        btnSetOk.setEnabled(false);
        btnsetDebug = new JButton("Set DeBug OK");
        btnsetDebug.setEnabled(false);

        lblLineNameValue.setEditable(false);
        lblCurrentStatusValue.setEditable(false);
        lblNextStationValue.setEditable(false);
        lblPcbaSnValue.setEditable(false);
        lblHeatSinkSnValue.setEditable(false);
        lblHousingSnValue.setEditable(false);
        lblThtSnValue.setEditable(false);
        lblDspSnValue.setEditable(false);
        lblGwSnValue.setEditable(false);
        lblStatusValue.setEditable(false);

        lblFgPnValue.setEditable(false);
        lblFgSnValue.setEditable(false);
        lblPcbaPnValue.setEditable(false);
        lblHeatSinkPnValue.setEditable(false);
        lblCustomerValue.setEditable(false);

        lblHousingPnValue.setEditable(false);
        lblGwPnValue.setEditable(false);
        lblDSPPPnValue.setEditable(false);
        lblDSPSPnValue.setEditable(false);

        btnSetOk.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSetOkActionPerformed(evt);
            }
        });
        btnsetDebug.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                btnDebugOkActionPerformed(e);
            }
        });

        DefaultTableCellRenderer tcr = new DefaultTableCellRenderer();
        tcr.setHorizontalAlignment(SwingConstants.CENTER);
        processDataTable.setDefaultRenderer(Object.class, tcr);

        lblLineNameKey.setText("Line Name:");
        lblCurrentStatusKey.setText("Current Status:");
        lblNextStationKey.setText("Next Station:");
        lblPcbaSnKey.setText("PCBA SN:");
        lblHeatSinkSnKey.setText("HeatSink SN:");
        lblHousingSnKey.setText("Housing SN:");
        lblThtSnKey.setText("DSP_P SN: ");
        lblDspSnKey.setText("DSP_S SN: ");
        lblGwSnKey.setText("GW SN: ");
        lblStatusKey.setText("Status:");

        lblFgPnKey.setText("PN:");
        lblFgSnKey.setText("FG SN:");
        lblPcbaPnKey.setText("PN:");
        lblHeatSinkPnKey.setText("PN:");
        lblCustomerKey.setText("Customer:");

        lblHousingPnKey.setText("PN:");
        lblGwPnKey.setText("PN:");
        lblDSPPPnKey.setText("PN:");
        lblDSPSPnSKey.setText("PN:");

        leftInfoPanel.setBorder(BorderFactory.createTitledBorder("Current Information"));
        leftInfoPanel.setLayout(new GridBagLayout());
        leftInfoPanel.add(lblLineNameKey, new GBC(0, 0).setFill(GBC.HORIZONTAL).setWeight
                (10, 0).setInsets(4, 5, 0, 2));
        leftInfoPanel.add(lblLineNameValue, new GBC(1, 0).setFill
                (GBC.HORIZONTAL).setWeight(90, 0).setInsets(1, 5, 0, 2));

        leftInfoPanel.add(lblCurrentStatusKey, new GBC(0, 1).setFill
                (GBC.HORIZONTAL).setWeight(10, 0).setInsets(4, 5, 0, 2));
        JPanel tempPanel = new JPanel();
        tempPanel.setLayout(new GridBagLayout());
        tempPanel.add(lblCurrentStatusValue, new GBC(0, 0).setFill
                (GBC.HORIZONTAL).setWeight(80, 0).setInsets(1, 5, 0, 2));
        tempPanel.add(btnSetOk, new GBC(1, 0).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(1, 5, 0, 2));
        tempPanel.add(btnsetDebug, new GBC(2, 0).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(1, 5, 0, 2));
        leftInfoPanel.add(tempPanel, new GBC(1, 1).setFill(GBC.HORIZONTAL).setWeight(90,
                0));

        leftInfoPanel.add(lblNextStationKey, new GBC(0, 2).setFill
                (GBC.HORIZONTAL).setWeight(10, 0).setInsets(4, 5, 0, 2));
        leftInfoPanel.add(lblNextStationValue, new GBC(1, 2).setFill
                (GBC.HORIZONTAL).setWeight(90, 0).setInsets(1, 5, 0, 2));
        leftInfoPanel.add(lblCustomerKey, new GBC(0, 3).setFill(GBC.HORIZONTAL).setWeight
                (10, 0).setInsets(4, 5, 0, 2));
        leftInfoPanel.add(lblCustomerValue, new GBC(1, 3).setFill
                (GBC.HORIZONTAL).setWeight(90, 0).setInsets(1, 5, 0, 2));
//        leftInfoPanel.add(lblFgPnKey, new GBC(0, 4).setFill(GBC.HORIZONTAL).setWeight(10,
//        0).setInsets(4, 5, 0, 2));
//        leftInfoPanel.add(lblFgPnValue, new GBC(1, 4).setFill(GBC.HORIZONTAL).setWeight
//        (90, 0).setInsets(1, 5, 0, 2));

        JPanel leftsn = new JPanel();
        leftsn.setLayout(new GridBagLayout());
        leftsn.add(lblFgSnKey, new GBC(0, 0).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 5, 2));
        leftsn.add(new JPanel(), new GBC(1,0).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(4, 5, 5, 2));
        leftsn.add(lblPcbaSnKey,new GBC(0,1).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 5, 2));

        leftsn.add(lblGwSnKey,new GBC(0,2).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 5, 2));
        leftsn.add(lblHeatSinkSnKey,new GBC(0,3).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 5, 2));
        leftsn.add(lblHousingSnKey,new GBC(0,4).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 5, 2));
        leftsn.add(lblThtSnKey,new GBC(0,5).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 5, 2));
        leftsn.add(lblDspSnKey,new GBC(0,6).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 5, 2));

        leftInfoPanel.add(leftsn, new GBC(0,5).setFill(GBC.HORIZONTAL));

        JPanel right = new JPanel();
        right.setLayout(new GridBagLayout());

        JPanel rightsnvalue = new JPanel();
        rightsnvalue.setLayout(new GridBagLayout());

        rightsnvalue.add(lblFgSnValue, new GBC(0, 0).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 2));
        rightsnvalue.add(lblPcbaSnValue, new GBC(0, 1).setFill(GBC.HORIZONTAL).setWeight
                (90, 0).setInsets(1, 5, 0, 2));
        rightsnvalue.add(lblGwSnValue, new GBC(0, 2).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 2));
        rightsnvalue.add(lblHeatSinkSnValue, new GBC(0, 3).setFill
                (GBC.HORIZONTAL).setWeight(90, 0).setInsets(1, 5, 0, 2));
        rightsnvalue.add(lblHousingSnValue, new GBC(0, 4).setFill
                (GBC.HORIZONTAL).setWeight(90, 0).setInsets(1, 5, 0, 2));
        rightsnvalue.add(lblThtSnValue, new GBC(0, 5).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 2));
        rightsnvalue.add(lblDspSnValue, new GBC(0, 6).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 2));

        right.add(rightsnvalue,new GBC(0,0).setFill(GBC.BOTH).setWeight(90,0));

        JPanel rightpn = new JPanel();
        rightpn.setLayout(new GridBagLayout());

        rightpn.add(lblFgPnKey, new GBC(0, 0).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        rightpn.add(lblFgPnValue, new GBC(1, 0).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 0));
        rightpn.add(lblPcbaPnKey, new GBC(0, 1).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        rightpn.add(lblPcbaPnValue, new GBC(1, 1).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 0));
        rightpn.add(lblGwPnKey, new GBC(0, 2).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        rightpn.add(lblGwPnValue, new GBC(1, 2).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 0));
        rightpn.add(lblHeatSinkPnKey, new GBC(0, 3).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        rightpn.add(lblHeatSinkPnValue, new GBC(1, 3).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 0));
        rightpn.add(lblHousingPnKey, new GBC(0, 4).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        rightpn.add(lblHousingPnValue, new GBC(1, 4).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 0));
        rightpn.add(lblDSPPPnKey, new GBC(0, 5).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        rightpn.add(lblDSPPPnValue, new GBC(1, 5).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 0));
        rightpn.add(lblDSPSPnSKey, new GBC(0, 6).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        rightpn.add(lblDSPSPnValue, new GBC(1, 6).setFill(GBC.HORIZONTAL).setWeight(90,
                0).setInsets(1, 5, 0, 0));

        right.add(rightpn,new GBC(1,0).setFill(GBC.BOTH).setWeight(100,0));

        leftInfoPanel.add(right, new GBC(1,5).setFill(GBC.HORIZONTAL));


        leftInfoPanel.add(lblStatusKey, new GBC(0, 6).setFill(GBC.HORIZONTAL).setWeight(10,
                0).setInsets(4, 5, 0, 2));
        leftInfoPanel.add(lblStatusValue, new GBC(1, 6).setFill(GBC.HORIZONTAL).setWeight
                (90, 0).setInsets(1, 5, 0, 2));

        rightInfoPanel.setBorder(BorderFactory.createTitledBorder("Process Data"));
        rightInfoPanel.setLayout(new GridBagLayout());
        scrollPane = new JScrollPane();
        scrollPane.setEnabled(false);
        processDataTable.setModel(processDataModal);

        processDataTable.getTableHeader().setVisible(true);
        processDataTable.getColumnModel().getColumn(0).setPreferredWidth(10);
        TableColumn column = null;
        for (int i = 0; i < processDataTable.getColumnCount(); i++) {
            column = processDataTable.getColumnModel().getColumn(i);
            if (i == 0) {
                column.setPreferredWidth(15);
            } else if (i == 1) {
                column.setPreferredWidth(5);
            } else {
                column.setPreferredWidth(150);
            }
        }
        scrollPane.setViewportView(processDataTable);
        rightInfoPanel.add(scrollPane, new GBC(0, 0).setFill(GBC.BOTH).setWeight(100,
                100));

        this.setLayout(new GridBagLayout());
        this.add(leftInfoPanel, new GBC(0, 0).setFill(GBC.BOTH).setWeight(40,
                100).setInsets(0, 0, 0, 10));
        this.add(rightInfoPanel, new GBC(1, 0).setFill(GBC.BOTH).setWeight(60, 100));
    }

    private void btnSetOkActionPerformed(ActionEvent evt) {
        try {
            mainController.updateCurrentStatusToOK(currentProductionId, AppConst.RESULT_OK);
            //research all data.
            EventBusUtils.post(new ResearchDataEvent(currentSn));
            EventBusUtils.post(new StatusBarChangeEvent(ResourceBundleUtils.getString
                    (ActionMessages.UPDATE_STATUS_DONE)));
        } catch (ApplicationException ex) {
            if(ResourceBundleUtils.getString(ex.getMessage()) == null || "".equals
                    (ResourceBundleUtils.getString(ex.getMessage()))){
                EventBusUtils.post(new StatusBarChangeEvent(ResourceBundleUtils.getString
                        (ExceptionMessages.EXCEPTION_GLOBAL_SYSTERM_ERROR), StatusBarChangeEvent.MSG_LEVEL_ERROR));
            }else
                EventBusUtils.post(new StatusBarChangeEvent(ResourceBundleUtils.getString
                        (ex.getMessage()), StatusBarChangeEvent.MSG_LEVEL_ERROR));
        }
    }

    private void btnDebugOkActionPerformed(ActionEvent evt) {
        try {
            mainController.updateCurrentStatusToOK(currentProductionId,
                    AppConst.RESULT_DEBUG);
            //research all data.
            EventBusUtils.post(new ResearchDataEvent(currentSn));
            EventBusUtils.post(new StatusBarChangeEvent(ResourceBundleUtils.getString
                    (ActionMessages.UPDATE_STATUS_DONE)));
        } catch (ApplicationException ex) {
            if(ResourceBundleUtils.getString(ex.getMessage()) == null || "".equals
                    (ResourceBundleUtils.getString(ex.getMessage()))){
                EventBusUtils.post(new StatusBarChangeEvent(ResourceBundleUtils.getString
                        (ExceptionMessages.EXCEPTION_GLOBAL_SYSTERM_ERROR), StatusBarChangeEvent.MSG_LEVEL_ERROR));
            }else
                EventBusUtils.post(new StatusBarChangeEvent(ResourceBundleUtils.getString
                        (ex.getMessage()), StatusBarChangeEvent.MSG_LEVEL_ERROR));
        }
    }

    private void clearTxtValue() {
        lblPcbaSnValue.setText("");
        lblPcbaPnValue.setText("");
        lblHeatSinkSnValue.setText("");
        lblHeatSinkPnValue.setText("");
        lblHousingSnValue.setText("");
        lblHousingPnValue.setText("");
        lblThtSnValue.setText("");
        lblDSPPPnValue.setText("");
        lblDspSnValue.setText("");
        lblDSPSPnValue.setText("");
        lblGwSnValue.setText("");
        lblGwPnValue.setText("");
        lblStatusValue.setText("");
        lblFgSnValue.setText("");
        lblFgPnValue.setText("");

        lblLineNameValue.setText("");
        lblCurrentStatusValue.setText("");
        lblNextStationValue.setText("");
        lblCustomerValue.setText("");

        btnSetOk.setEnabled(false);
        btnsetDebug.setEnabled(false);

    }

    private JPanel leftInfoPanel;
    private JPanel rightInfoPanel;
    private JLabel lblLineNameKey;
    private JTextField lblLineNameValue;
    private JLabel lblCurrentStatusKey;
    private JTextField lblCurrentStatusValue;
    private JLabel lblNextStationKey;
    private JTextField lblNextStationValue;
    private JLabel lblPcbaSnKey;
    private JTextField lblPcbaSnValue;
    private JLabel lblHeatSinkSnKey;
    private JTextField lblHeatSinkSnValue;
    private JLabel lblHousingSnKey;
    private JTextField lblHousingSnValue;
    private JLabel lblThtSnKey;
    private JTextField lblThtSnValue;
    private JLabel lblDspSnKey;
    private JTextField lblDspSnValue;
    private JLabel lblGwSnKey;
    private JTextField lblGwSnValue;
    private JLabel lblStatusKey;
    private JTextField lblStatusValue;
    private JTableEx processDataTable;
    private JScrollPane scrollPane;

    private JLabel lblFgSnKey;
    private JTextField lblFgSnValue;
    private JLabel lblFgPnKey;
    private JTextField lblFgPnValue;
    private JLabel lblPcbaPnKey;
    private JTextField lblPcbaPnValue;
    private JLabel lblHeatSinkPnKey;
    private JTextField lblHeatSinkPnValue;
    private JLabel lblCustomerKey;
    private JTextField lblCustomerValue;

    private JLabel lblHousingPnKey;
    private JTextField lblHousingPnValue;
    private JLabel lblGwPnKey;
    private JTextField lblGwPnValue;
    private JLabel lblDSPPPnKey;
    private JTextField lblDSPPPnValue;
    private JLabel lblDSPSPnSKey;
    private JTextField lblDSPSPnValue;

    private JButton btnSetOk;
    private JButton btnsetDebug;
}
